stop

open fun stop()

Stops or pauses the active operation of this control.

This typically involves pausing content playback, animations, or data fetching, and potentially reducing resource consumption. The control should retain its state so it can be resumed by #start().

Calling stop()} on an already stopped control should be a no-op.

Stops the playback of stories.

This method performs the following actions:

  • Sets the isStarted flag to false.
  • Removes any pending callbacks for nextRunnable, autoNextRunnable, and updateRunnable from their respective handlers.
  • Stops video playback using videoImpl.stopPlayback().
  • If mediaPlayer is not null, stops and releases it.
  • Cancels any ongoing animations on imageContainer, videoContainer, and web (if not null).
  • Sets the visibility of imageContainer to INVISIBLE.
  • Sets the visibility of videoContainer to GONE.
  • If web is not null:
    • Executes JavaScript to call RevelDigital.Controller.onStop().
    • Triggers a JavaScript event named "RevelDigital.Stop".
    • Sets the visibility of web to INVISIBLE and its alpha to 0.